#ifndef SOLUTION_H_
#define SOLUTION_H_
#include <algorithm>
using namespace std;
class Solution {
public:
    bool canJump(int A[], int n) {
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
        int i=0, m = 0;
		while(i<=m)
		{
			m = max(m,A[i]+i);
			if(m>=(n-1))
				return true;
			i++;
		}
		return false;

    }
};
#endif